<?php
ini_set('display_errors', 0);
  session_start();  
$_SESSION['usuarios'];
$_SESSION['passwords'];

if ($_SESSION['usuarios'] == "" and $_SESSION['passwords'] == ""){
	echo " uste no tiene permiso pa ver esta pagina";
	die;
}
$usuarios6 = $_SESSION['usuarios'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title> Sistema Integral de Bienestar Social</title>
<link href="media/styles00.css" rel="stylesheet" type="text/css" />
<link href="media/nivo-sli.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="media/jquery-1.js"></script>
<script type="text/javascript" src="media/jquery00.js"></script>
<script src="media/cufon-yu.js" type="text/javascript"></script>
<script src="media/Sunshine.js" type="text/javascript"></script>
<script type="text/javascript">
Cufon.replace('h1');
Cufon.replace('h3');
Cufon.replace('.special_font');
Cufon.replace('h2 a', {
	hover: true
});
Cufon.replace('h2');
Cufon.replace('#navigation a', {
	hover: true
});
</script>
<script type="text/javascript" src="media/jquery01.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
<!--[if IE 6]><script defer type="text/javascript" src="js/pngfix.js"></script><![endif]-->
<!--[if !IE 7]>
<style type="text/css">
#bg_top {display:table;height:100%}
h1 {padding-top:5px;}
</style>
<![endif]-->
<link rel="stylesheet" href="media/jquery00.css" type="text/css" />
<script type="text/javascript" src="media/jquery02.js"></script>
<script type="text/javascript">
$(function() { $('.lightbox').lightBox(); });
</script>
</head>
<body>
<div id="bg_top">
  <div id="wrapper">
    <div id="header">
      <div id="logo"><img src="media/logo0000.png" width="289" height="54" alt="Logo" /></div>
      <div id="cloud1" class="special_font"> otic  </div>
      <div id="cloud2" class="special_font"> m.p.p.s</div>
      <div id="menu">
        <ul id="navigation">
          <a  style="border:none;"> Sistema Integral de Bienestar Social</a>
        </ul>
      </div>
    </div>
    <div id="content_bg">
      <div id="content">
        
        
<p align="center">
<?php 
include 'conex.php';
$cedula = $_POST['cedula'];
$nac = $_POST['nac']; 

$consulta="select cedula, nac, nombres||' '||apellidos as padre from guar_trabajador where cedula = '$cedula' and nac = '$nac'";

$consulta=pg_query($consulta);
while ($var = pg_fetch_array($consulta)) {
$consulta_nac = $var['nac'];
$consulta_cedula = $var['cedula'];
$padre = $var['padre']; }

if ($consulta_cedula== "" and $consulta_nac == ""){
echo "Cedula No Registrada!";
}

if ($consulta_cedula == $cedula and $consulta_nac == $nac){

?>
</p>
        
          
		<table align="center" width="440px" height="120px">
		<td  align="center" width="250px">
          <h1>Consulta del Trabajador </h1>
          
          <form name= "funcionario1" id= "funcionario1" method= "post" action= "funcionarios.php">
				<table p align="center" width="400px" height="100px">
				<tr><td align="center">
				<font class= "color"> Nombre del hijo: </font>
				<font><select name= "nombres_hijo"></font>

<?php

$hijo="select distinct nombres_hijo,
 apellidos_hijo 
 from guar_nomina 
 where cedula = '$cedula' and nac = '$nac'"; 
 $consulta_hijo=pg_query($hijo);
while ($var = pg_fetch_array($consulta_hijo)) {
?>
						<option value="<?php echo $var['nombres_hijo']; ?> <?php echo $var['apellidos_hijo']; ?>"><?php echo $var['nombres_hijo']; ?> <?php echo $var['apellidos_hijo']; ?></option>
					<?php
					}
					?>
					</select>
				</td></tr>
				<tr><td align="center"><font class= "color"> Seleccione: </font>
				<font><select name= "fecha"></font>
					<option value="2009">Todos</option>
					<?php 
					$year = date('Y');
					for ($y=2010; $y <= $year; $y++) { 	
						?>
						<option value="<?php echo $y; ?>"><?php echo $y; ?></option>
					<?php
					}
					?>
					</select>
				</td></tr>
				</table>
				</p>
				<input type= "hidden" name="nac" value="<?php echo $nac; ?> ">
				<input type= "hidden" name="cedula" value="<?php echo $cedula; ?> ">
				<input type= "hidden" name="padre" value="<?php echo $padre; ?> ">
					<p align="center">
						<br>
						<input type="submit" value="Consulta"/>
						</br>
<?php
}
?>
						<br></br>
						<br>
						<a href="consulta_user.php"><img src="1356055280_Forward-64.png" height="30px" width="30px" /></a>
						</br>
						</p>
						</form>
        </td>
		</table>
          <p>&nbsp;</p>
        </div>
        <br class="clear" />
      </div>
      <br class="clear" />
    </div>
    <div id="content_bottom"><img src="media/content_.jpg" width="980" height="5" alt="bottom" /></div>
    <div id="footer">
     
    </div>
  </div>
</div>
<div id="grass">
  <div id="footer_design"> </div>
</div>
<script type="text/javascript"> Cufon.now(); </script>
</body>
</html>